package com.telecom.cms.actions;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.telecom.cms.dao.LOC_LATNDAO;
import com.telecom.cms.dto.*;

/**
 * @author yueyingnishang
 * 
 */
public class QuerycancelAction extends Action {

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping,
	 *      org.apache.struts.action.ActionForm,
	 *      javax.servlet.http.HttpServletRequest,
	 *      javax.servlet.http.HttpServletResponse)
	 */
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		// List list1 = new ArrayList();
		// List list2 = new ArrayList();

		// request.getSession().setAttribute("AtomList", list1);
		// request.getSession().setAttribute("Outputlist", list2);

		String Latn_id = (String) request.getSession().getAttribute("oldid");
		LOC_LATNDTO dto = new LOC_LATNDAO().findById(Latn_id);
		String latncd = dto.getLatn_cd();
		String latndesc = dto.getLatn_desc();
		request.getSession().setAttribute("latndesc", latndesc);
		request.getSession().setAttribute("latncd", latncd);
		request.getSession().setAttribute("latnid",Latn_id) ;  
		request.getSession().removeAttribute("AtomList");
		request.getSession().removeAttribute("Outputlist");
		request.getSession().removeAttribute("Sqllist");

		return mapping.findForward("success");
	}

}
